/**
 * @format
 * @Author: TC
 * @Date: 2021-09-27 18:03:26
 * @Last Modified by: TC
 * @Last Modified time: 2021-09-29 14:07:38
 */

import { _decorator, Label, Node, tween } from "cc";
import { mFrameEnumConst } from "../../FrameWork/Const/FrameEnumConst";
import { BaseComponent } from "../../FrameWork/Module/Component/BaseComponent";

const { ccclass, property } = _decorator;

@ccclass("WaitWindow")
export class WaitWindow extends BaseComponent {
    @property(Label)
    tipTxt: Label = null;
    @property(Node)
    circle: Node = null;

    onLoad() {
        super.onLoad();
        this.node.setSiblingIndex(mFrameEnumConst.Z_INDEX.WAIT);
    }

    onEnable() {
        this.tipTxt.string = this.node.name;
        tween(this.circle).stop();
        tween(this.circle)
            .repeatForever(tween(this.circle).to(10, { angle: 360 }))
            .start();
    }
}
